<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('hires', function (Blueprint $table) {
            $table->id();
            $table->integer('company_id')->default(0);
            $table->string('company_name')->nullable()->comment('企业名称');
            $table->string('title')->nullable()->comment('职位名称');
            $table->text('description')->nullable()->comment('职位描述');
            $table->string('department')->nullable()->comment('所属部门');
            $table->integer('salary_min')->nullable()->comment('最低薪资');
            $table->integer('salary_max')->nullable()->comment('最高薪资');
            $table->string('salary_type')->nullable()->comment('薪资类型');
            $table->string('location')->nullable()->comment('工作地点');
            $table->string('experience')->nullable()->comment('工作经验要求');
            $table->string('education')->nullable()->comment('学历要求');
            $table->integer('headcount')->nullable()->comment('招聘人数');
            $table->string('status')->default('开放')->comment('职位状态');
            $table->date('deadline')->nullable()->comment('截止日期');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('hires');
    }
};
